import os

def by_name(path: str, case_sensitive=False) -> list:
    '''
        Sorts all entries (files, directories, etc.) in directory (given by path argument) by name (alphabetical order).
        Can be either case_sensitive and not case_sensitive.
        I.e. ["d", "Z", "a"] will be ["Z", "a", "d"], if case_sensitive is True.
        And same list will be ["a", "d", "Z"], if case_sensitive is False.
        Returns sorted list of entries.
    '''

    entries = os.listdir(path)

    if not case_sensitive:
        return sorted(entries, key=lambda x: x.upper())
    else:
        return sorted(entries)

